<template>
    <div>
        <h2>{{store.msg}}</h2>
        <button @click="UpdataMeg">修改仓库里的信息</button>
        <input type="text" v-model="addres">
    </div>
</template>

<script setup>
import { inject, onMounted, ref } from 'vue';
import store from '../store';
import axios from 'axios'

inject('school', store)
function UpdataMeg() {
    store.Updata()
}
const addres = ref('beijing')
console.log(addres.value);
onMounted(() => {
    //前面是使用ES6的fetch来获取数据
    // fetch(`https://www.tianqiapi.com/free/day?appid=56761788&appsecret=ti3hP8y9&city=${addres.value}`).then((res) => {
    //     console.log(res.json());
    // }).then((res) => {
    //     console.log(res);
    // })
    //axios
    axios.get(`/path/user/FindAll`).then((res) => {
        console.log(res);
    })
})
</script>

<style lang="scss" scoped>

</style>